package br.utfpr.edu.dao;

import java.util.List;

import br.utfpr.edu.bean.Familia;
import br.utfpr.edu.business.Negocio;
import br.utfpr.edu.business.NegocioException;

public class FamiliaDao extends Negocio{
	
	private static final long serialVersionUID = -7284791492891083327L;
	private Familia familia;
	public static List<Familia>colecao;
	
	public FamiliaDao(){
		familia = new Familia();
		limpar();
	}
	
	@Override
	public void limpar() {
		familia.setDescricao("");
		familia.setId(null);
	}
	
	public void pesquisar()throws NegocioException{
		colecao = getList(Familia.class,"SELECT f FROM Familia f ORDER BY f.descricao");
	}
	
	public void inserir()throws NegocioException{
		super.inserir(familia);
	}

	public Familia getFamilia() {
		return familia;
	}

	public void setFamilia(Familia familia) {
		this.familia = familia;
	}

}
